package Book;

public class BookList {
    private book[] books = new book[10];//模拟书架，能存放的图书总数
    private int UsedSize;//实际存放图书数目


    //构造方法并对其书架上面的书初始化
    //我们假设现在设定暂放3本书，所以usedSize也为3
    public BookList(){
        this.books[0]=new book("人类简史","尤瓦尔·赫拉利","小说",68);
        this.books[1]=new book("解忧杂货店","东野圭吾","小说",39);
        this.books[2]=new book("人生海海","麦家","小说",55);
        this.UsedSize = 3;
    }

    //因为private的访问限制，分别构造出books和 UsedSize的 get和set方法

    public book getBooks(int pos) {
        return books[pos];
    }

    public void setBooks(book books,int pos) {
        this.books[pos] = books;
    }

    public int getUsedSize() {
        return UsedSize;
    }

    public void setUsedSize(int usedSize) {
        UsedSize = usedSize;
    }
}
